package com.shell.customer.invitation.controller;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.mvc.controller.BaseController;
import com.shell.bee.persistence.model.PageLimit;
import com.shell.customer.invitation.service.InviteStatisticsService;
import com.shell.customer.invitation.vo.InviteStatisticsVo;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class InviteStatisticsController extends BaseController {
	@Autowired
	private InviteStatisticsService inviteStatisticsService;
	protected final Log logger = LogFactory.getLog(getClass());

	@RequestMapping
	@Logging(module = "��������", methods = "����������������")
	public List<InviteStatisticsVo> getInviteStatisticsList(PageLimit limit,
			@RequestParam(name = "cusType", required = false) String cusType,
			@RequestParam(name = "searchStr", required = false) String searchStr) {
		return this.inviteStatisticsService.getInviteStatisticsList(limit, cusType, searchStr);
	}

	@RequestMapping
	@Logging(module = "��������", methods = "����������������")
	public List<InviteStatisticsVo> getInviteStatisticsDetail(@RequestParam(name = "userId") String userId,
			@RequestParam(name = "statisticsType") String statisticsType) {
		return this.inviteStatisticsService.getInviteStatisticsDetail(userId, statisticsType);
	}

	@RequestMapping
	@Logging(module = "��������", methods = "����������������")
	public Map<String, Object> getInviteStatisticsTotal(
			@RequestParam(name = "cusType", required = false) String cusType,
			@RequestParam(name = "searchStr", required = false) String searchStr) {
		return this.inviteStatisticsService.getInviteStatisticsTotal(cusType, searchStr);
	}
}
